package Exer03_分支;

import java.util.Scanner;
public class _1_3_1_数值互换2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入第一个数：");
        int num1 = scanner.nextInt();
        System.out.println("请输入第二个数：");
        int num2 = scanner.nextInt();
        System.out.println("请输入第三个数：");
        int num3 = scanner.nextInt();
        int temp;
        if (num1 > num2){
            temp = num1;
            num1 = num2;
            num2 = temp;
        }
        if (num1 > num3){
            temp = num1;
            num1 = num3;
            num3 = temp;
        }
        if (num2 > num3){
            temp = num2;
            num2 = num3;
            num3 = temp;
        }
        System.out.println("num1 = " + num1 +", " + "num2 = "+ num2 + ", " + "num3 = " + num3);
        scanner.close();
    }
}

